package com.ruoyi.function.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.function.mapper.TollDataSummaryMapper;
import com.ruoyi.function.domain.TollDataSummary;
import com.ruoyi.function.service.ITollDataSummaryService;

/**
 * 收费数据汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-11
 */
@Service
public class TollDataSummaryServiceImpl implements ITollDataSummaryService 
{
    @Autowired
    private TollDataSummaryMapper tollDataSummaryMapper;

    /**
     * 查询收费数据汇总
     * 
     * @param id 收费数据汇总主键
     * @return 收费数据汇总
     */
    @Override
    public TollDataSummary selectTollDataSummaryById(Long id)
    {
        return tollDataSummaryMapper.selectTollDataSummaryById(id);
    }

    /**
     * 查询收费数据汇总列表
     * 
     * @param tollDataSummary 收费数据汇总
     * @return 收费数据汇总
     */
    @Override
    public List<TollDataSummary> selectTollDataSummaryList(TollDataSummary tollDataSummary)
    {
        return tollDataSummaryMapper.selectTollDataSummaryList(tollDataSummary);
    }

    /**
     * 新增收费数据汇总
     * 
     * @param tollDataSummary 收费数据汇总
     * @return 结果
     */
    @Override
    public int insertTollDataSummary(TollDataSummary tollDataSummary)
    {
        return tollDataSummaryMapper.insertTollDataSummary(tollDataSummary);
    }

    /**
     * 修改收费数据汇总
     * 
     * @param tollDataSummary 收费数据汇总
     * @return 结果
     */
    @Override
    public int updateTollDataSummary(TollDataSummary tollDataSummary)
    {
        return tollDataSummaryMapper.updateTollDataSummary(tollDataSummary);
    }

    /**
     * 批量删除收费数据汇总
     * 
     * @param ids 需要删除的收费数据汇总主键
     * @return 结果
     */
    @Override
    public int deleteTollDataSummaryByIds(Long[] ids)
    {
        return tollDataSummaryMapper.deleteTollDataSummaryByIds(ids);
    }

    /**
     * 删除收费数据汇总信息
     * 
     * @param id 收费数据汇总主键
     * @return 结果
     */
    @Override
    public int deleteTollDataSummaryById(Long id)
    {
        return tollDataSummaryMapper.deleteTollDataSummaryById(id);
    }

    @Override
    public boolean hasChildById(Long id)
    {
        return tollDataSummaryMapper.hasChildById(id) > 0;
    }
}
